<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GtkCellLayout</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 3 参考手册">
<link rel="up" href="TreeWidgetObjects.html" title="树、列表和图标网格构件">
<link rel="prev" href="gtk3-GtkTreeModelFilter.html" title="GtkTreeModelFilter">
<link rel="next" href="gtk3-GtkCellArea.html" title="GtkCellArea">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk3-GtkTreeModelFilter.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="TreeWidgetObjects.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 3 参考手册</th>
<td><a accesskey="n" href="gtk3-GtkCellArea.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk3-GtkCellLayout.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk3-GtkCellLayout.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk3-GtkCellLayout"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk3-GtkCellLayout.top_of_page"></a>GtkCellLayout</span></h2>
<p>GtkCellLayout — An interface for packing cells</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk3-GtkCellLayout.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

                    <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout">GtkCellLayout</a>;
struct              <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayoutIface" title="struct GtkCellLayoutIface">GtkCellLayoutIface</a>;
<span class="returnvalue">void</span>                (<a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayoutDataFunc" title="GtkCellLayoutDataFunc ()">*GtkCellLayoutDataFunc</a>)            (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkTreeModel.html#GtkTreeModel" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *tree_model</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkTreeModel.html#GtkTreeIter" title="struct GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-pack-start" title="gtk_cell_layout_pack_start ()">gtk_cell_layout_pack_start</a>          (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> expand</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-pack-end" title="gtk_cell_layout_pack_end ()">gtk_cell_layout_pack_end</a>            (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> expand</code></em>);
<a class="link" href="gtk3-GtkCellArea.html#GtkCellArea" title="struct GtkCellArea"><span class="returnvalue">GtkCellArea</span></a> *       <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-get-area" title="gtk_cell_layout_get_area ()">gtk_cell_layout_get_area</a>            (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>);
<a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-get-cells" title="gtk_cell_layout_get_cells ()">gtk_cell_layout_get_cells</a>           (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-reorder" title="gtk_cell_layout_reorder ()">gtk_cell_layout_reorder</a>             (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-clear" title="gtk_cell_layout_clear ()">gtk_cell_layout_clear</a>               (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-set-attributes" title="gtk_cell_layout_set_attributes ()">gtk_cell_layout_set_attributes</a>      (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code>...</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-add-attribute" title="gtk_cell_layout_add_attribute ()">gtk_cell_layout_add_attribute</a>       (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *attribute</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> column</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-set-cell-data-func" title="gtk_cell_layout_set_cell_data_func ()">gtk_cell_layout_set_cell_data_func</a>  (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayoutDataFunc" title="GtkCellLayoutDataFunc ()"><span class="type">GtkCellLayoutDataFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-clear-attributes" title="gtk_cell_layout_clear_attributes ()">gtk_cell_layout_clear_attributes</a>    (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk3-GtkCellLayout.description"></a><h2>Description</h2>
<p>
<a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> is an interface to be implemented by all objects which
want to provide a <span class="type">GtkTreeViewColumn-like</span> API for packing cells, setting
attributes and data funcs.
</p>
<p>
One of the notable features provided by implementations of GtkCellLayout
are <span class="emphasis"><em>attributes</em></span>. Attributes let you set the properties
in flexible ways. They can just be set to constant values like regular
properties. But they can also be mapped to a column of the underlying
tree model with <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-set-attributes" title="gtk_cell_layout_set_attributes ()"><code class="function">gtk_cell_layout_set_attributes()</code></a>, which means that the value
of the attribute can change from cell to cell as they are rendered by the
cell renderer. Finally, it is possible to specify a function with
<a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-set-cell-data-func" title="gtk_cell_layout_set_cell_data_func ()"><code class="function">gtk_cell_layout_set_cell_data_func()</code></a> that is called to determine the value
of the attribute for each cell that is rendered.
</p>
<p>
</p>
<div class="refsect2">
<a name="GtkCellLayout-BUILDER-UI"></a><h3>GtkCellLayouts as GtkBuildable</h3>
<p>
Implementations of GtkCellLayout which also implement the GtkBuildable
interface (<a class="link" href="gtk3-GtkCellView.html#GtkCellView" title="struct GtkCellView"><span class="type">GtkCellView</span></a>, <a class="link" href="gtk3-GtkIconView.html#GtkIconView" title="struct GtkIconView"><span class="type">GtkIconView</span></a>, <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a>, <span class="type">GtkComboBoxEntry</span>,
<a class="link" href="gtk3-GtkEntryCompletion.html#GtkEntryCompletion" title="struct GtkEntryCompletion"><span class="type">GtkEntryCompletion</span></a>, <a class="link" href="gtk3-GtkTreeViewColumn.html#GtkTreeViewColumn" title="struct GtkTreeViewColumn"><span class="type">GtkTreeViewColumn</span></a>) accept GtkCellRenderer objects
as &lt;child&gt; elements in UI definitions. They support a custom
&lt;attributes&gt; element for their children, which can contain
multiple &lt;attribute&gt; elements. Each &lt;attribute&gt; element has
a name attribute which specifies a property of the cell renderer; the
content of the element is the attribute value.
</p>
<p>
</p>
<div class="example">
<a name="id3503872"></a><p class="title"><b>Example 59. A UI definition fragment specifying attributes</b></p>
<div class="example-contents"><pre class="programlisting">
&lt;object class="GtkCellView"&gt;
  &lt;child&gt;
    &lt;object class="GtkCellRendererText"/&gt;
    &lt;attributes&gt;
      &lt;attribute name="text"&gt;0&lt;/attribute&gt;
    &lt;/attributes&gt;
  &lt;/child&gt;"
&lt;/object&gt;
</pre></div>
</div>
<p><br class="example-break">
</p>
<p>
Furthermore for implementations of GtkCellLayout that use a <a class="link" href="gtk3-GtkCellArea.html#GtkCellArea" title="struct GtkCellArea"><span class="type">GtkCellArea</span></a>
to lay out cells (all GtkCellLayouts in GTK+ use a GtkCellArea)
<a class="link" href="gtk3-GtkCellArea.html#cell-properties" title="Cell Properties">cell properties</a> can also be defined
in the format by specifying the custom &lt;cell-packing&gt; attribute which
can contain multiple &lt;property&gt; elements defined in the normal way.
</p>
<div class="example">
<a name="id3427332"></a><p class="title"><b>Example 60. A UI definition fragment specifying cell properties</b></p>
<div class="example-contents"><pre class="programlisting">
&lt;object class="GtkTreeViewColumn"&gt;
  &lt;child&gt;
    &lt;object class="GtkCellRendererText"/&gt;
    &lt;cell-packing&gt;
      &lt;property name="align"&gt;True&lt;/property&gt;
      &lt;property name="expand"&gt;False&lt;/property&gt;
    &lt;/cell-packing&gt;
  &lt;/child&gt;"
&lt;/object&gt;
</pre></div>
</div>
<p><br class="example-break">
</p>
</div>
<p>
</p>
<p>
</p>
<div class="refsect2">
<a name="id3456382"></a><h3>Subclassing GtkCellLayout implementations</h3>
<p>
When subclassing a widget that implements <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> like
<a class="link" href="gtk3-GtkIconView.html#GtkIconView" title="struct GtkIconView"><span class="type">GtkIconView</span></a> or <a class="link" href="gtk3-GtkComboBox.html#GtkComboBox" title="struct GtkComboBox"><span class="type">GtkComboBox</span></a>, there are some considerations related
to the fact that these widgets internally use a <a class="link" href="gtk3-GtkCellArea.html#GtkCellArea" title="struct GtkCellArea"><span class="type">GtkCellArea</span></a>.
The cell area is exposed as a construct-only property by these
widgets. This means that it is possible to e.g. do
</p>
<div class="informalexample"><pre class="programlisting">
combo = g_object_new (GTK_TYPE_COMBO_BOX, "cell-area", my_cell_area, NULL);
</pre></div>
<p>
to use a custom cell area with a combo box. But construct properties
are only initialized <span class="emphasis"><em>after</em></span> instance <code class="function">init()</code>
functions have run, which means that using functions which rely on
the existence of the cell area in your subclass' <code class="function">init()</code> function will
cause the default cell area to be instantiated. In this case, a provided
construct property value will be ignored (with a warning, to alert
you to the problem).
</p>
<div class="informalexample"><pre class="programlisting">
static void
my_combo_box_init (MyComboBox *b)
{
  GtkCellRenderer *cell;

  cell = gtk_cell_renderer_pixbuf_new ();
  /* The following call causes the default cell area for combo boxes,
   * a GtkCellAreaBox, to be instantiated
   */
  gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (b), cell, FALSE);
  ...
}

GtkWidget *
my_combo_box_new (GtkCellArea *area)
{
  /* This call is going to cause a warning
   * about area being ignored
   */
  return g_object_new (MY_TYPE_COMBO_BOX, "cell-area", area, NULL);
}
</pre></div>
<p>
If supporting alternative cell areas with your derived widget is
not important, then this does not have to concern you. If you want
to support alternative cell areas, you can do so by moving the
problematic calls out of <code class="function">init()</code> and into a <code class="function">constructor()</code>
for your class.
</p>
</div>
<p>
</p>
</div>
<div class="refsect1">
<a name="gtk3-GtkCellLayout.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GtkCellLayout"></a><h3>GtkCellLayout</h3>
<pre class="programlisting">typedef struct _GtkCellLayout GtkCellLayout;</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkCellLayoutIface"></a><h3>struct GtkCellLayoutIface</h3>
<pre class="programlisting">struct GtkCellLayoutIface {
  GTypeInterface g_iface;

  /* Virtual Table */
  void (* pack_start)         (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               gboolean               expand);
  void (* pack_end)           (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               gboolean               expand);
  void (* clear)              (GtkCellLayout         *cell_layout);
  void (* add_attribute)      (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               const gchar           *attribute,
                               gint                   column);
  void (* set_cell_data_func) (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               GtkCellLayoutDataFunc  func,
                               gpointer               func_data,
                               GDestroyNotify         destroy);
  void (* clear_attributes)   (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell);
  void (* reorder)            (GtkCellLayout         *cell_layout,
                               GtkCellRenderer       *cell,
                               gint                   position);
  GList* (* get_cells)        (GtkCellLayout         *cell_layout);

  GtkCellArea *(* get_area)   (GtkCellLayout         *cell_layout);
};
</pre>
<p>
</p>
</div>
<hr>
<div class="refsect2">
<a name="GtkCellLayoutDataFunc"></a><h3>GtkCellLayoutDataFunc ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                (*GtkCellLayoutDataFunc)            (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkTreeModel.html#GtkTreeModel" title="GtkTreeModel"><span class="type">GtkTreeModel</span></a> *tree_model</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkTreeModel.html#GtkTreeIter" title="struct GtkTreeIter"><span class="type">GtkTreeIter</span></a> *iter</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>);</pre>
<p>
A function which should set the value of <em class="parameter"><code>cell_layout</code></em>'s cell renderer(s)
as appropriate.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>the cell renderer whose value is to be set</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>tree_model</code></em> :</span></p></td>
<td>the model</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>iter</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkTreeModel.html#GtkTreeIter" title="struct GtkTreeIter"><span class="type">GtkTreeIter</span></a> indicating the row to set the value for</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
<td>user data passed to <a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-set-cell-data-func" title="gtk_cell_layout_set_cell_data_func ()"><code class="function">gtk_cell_layout_set_cell_data_func()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-pack-start"></a><h3>gtk_cell_layout_pack_start ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_pack_start          (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> expand</code></em>);</pre>
<p>
Packs the <em class="parameter"><code>cell</code></em> into the beginning of <em class="parameter"><code>cell_layout</code></em>. If <em class="parameter"><code>expand</code></em> is <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>,
then the <em class="parameter"><code>cell</code></em> is allocated no more space than it needs. Any unused space
is divided evenly between cells for which <em class="parameter"><code>expand</code></em> is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.
</p>
<p>
Note that reusing the same cell renderer is not supported.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>expand</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>cell</code></em> is to be given extra space allocated to <em class="parameter"><code>cell_layout</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-pack-end"></a><h3>gtk_cell_layout_pack_end ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_pack_end            (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> expand</code></em>);</pre>
<p>
Adds the <em class="parameter"><code>cell</code></em> to the end of <em class="parameter"><code>cell_layout</code></em>. If <em class="parameter"><code>expand</code></em> is <a href="../glib/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>, then the
<em class="parameter"><code>cell</code></em> is allocated no more space than it needs. Any unused space is
divided evenly between cells for which <em class="parameter"><code>expand</code></em> is <a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>.
</p>
<p>
Note that reusing the same cell renderer is not supported.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>expand</code></em> :</span></p></td>
<td>
<a href="../glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>cell</code></em> is to be given extra space allocated to <em class="parameter"><code>cell_layout</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-get-area"></a><h3>gtk_cell_layout_get_area ()</h3>
<pre class="programlisting"><a class="link" href="gtk3-GtkCellArea.html#GtkCellArea" title="struct GtkCellArea"><span class="returnvalue">GtkCellArea</span></a> *       gtk_cell_layout_get_area            (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>);</pre>
<p>
Returns the underlying <a class="link" href="gtk3-GtkCellArea.html#GtkCellArea" title="struct GtkCellArea"><span class="type">GtkCellArea</span></a> which might be <em class="parameter"><code>cell_layout</code></em>
if called on a <a class="link" href="gtk3-GtkCellArea.html#GtkCellArea" title="struct GtkCellArea"><span class="type">GtkCellArea</span></a> or might be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no <a class="link" href="gtk3-GtkCellArea.html#GtkCellArea" title="struct GtkCellArea"><span class="type">GtkCellArea</span></a>
is used by <em class="parameter"><code>cell_layout</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>the cell area used by <em class="parameter"><code>cell_layout</code></em>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 3.0</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-get-cells"></a><h3>gtk_cell_layout_get_cells ()</h3>
<pre class="programlisting"><a href="../glib/glib-Doubly-Linked-Lists.html#GList"><span class="returnvalue">GList</span></a> *             gtk_cell_layout_get_cells           (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>);</pre>
<p>
Returns the cell renderers which have been added to <em class="parameter"><code>cell_layout</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a list of cell renderers. The list, but not the renderers has
been newly allocated and should be freed with <a href="../glib/glib-Doubly-Linked-Lists.html#g-list-free"><code class="function">g_list_free()</code></a>
when no longer needed. <span class="annotation">[<acronym title="Generics and defining elements of containers and arrays."><span class="acronym">element-type</span></acronym> GtkCellRenderer][<acronym title="Free data container after the code is done."><span class="acronym">transfer container</span></acronym>]</span>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.12</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-reorder"></a><h3>gtk_cell_layout_reorder ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_reorder             (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> position</code></em>);</pre>
<p>
Re-inserts <em class="parameter"><code>cell</code></em> at <em class="parameter"><code>position</code></em>.
</p>
<p>
Note that <em class="parameter"><code>cell</code></em> has already to be packed into <em class="parameter"><code>cell_layout</code></em>
for this to function properly.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> to reorder</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>position</code></em> :</span></p></td>
<td>new position to insert <em class="parameter"><code>cell</code></em> at</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-clear"></a><h3>gtk_cell_layout_clear ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_clear               (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>);</pre>
<p>
Unsets all the mappings on all renderers on <em class="parameter"><code>cell_layout</code></em> and
removes all renderers from <em class="parameter"><code>cell_layout</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-set-attributes"></a><h3>gtk_cell_layout_set_attributes ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_set_attributes      (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code>...</code></em>);</pre>
<p>
Sets the attributes in list as the attributes of <em class="parameter"><code>cell_layout</code></em>.
</p>
<p>
The attributes should be in attribute/column order, as in
<a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-add-attribute" title="gtk_cell_layout_add_attribute ()"><code class="function">gtk_cell_layout_add_attribute()</code></a>. All existing attributes are
removed, and replaced with the new attributes.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-add-attribute"></a><h3>gtk_cell_layout_add_attribute ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_add_attribute       (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code>const <a href="../glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *attribute</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> column</code></em>);</pre>
<p>
Adds an attribute mapping to the list in <em class="parameter"><code>cell_layout</code></em>.
</p>
<p>
The <em class="parameter"><code>column</code></em> is the column of the model to get a value from, and the
<em class="parameter"><code>attribute</code></em> is the parameter on <em class="parameter"><code>cell</code></em> to be set from the value. So for
example if column 2 of the model contains strings, you could have the
"text" attribute of a <a class="link" href="gtk3-GtkCellRendererText.html#GtkCellRendererText" title="struct GtkCellRendererText"><span class="type">GtkCellRendererText</span></a> get its values from column 2.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>attribute</code></em> :</span></p></td>
<td>an attribute on the renderer</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>column</code></em> :</span></p></td>
<td>the column position on the model to get the attribute from</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-set-cell-data-func"></a><h3>gtk_cell_layout_set_cell_data_func ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_set_cell_data_func  (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayoutDataFunc" title="GtkCellLayoutDataFunc ()"><span class="type">GtkCellLayoutDataFunc</span></a> func</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>,
                                                         <em class="parameter"><code><a href="../glib/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy</code></em>);</pre>
<p>
Sets the <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayoutDataFunc" title="GtkCellLayoutDataFunc ()"><span class="type">GtkCellLayoutDataFunc</span></a> to use for <em class="parameter"><code>cell_layout</code></em>.
</p>
<p>
This function is used instead of the standard attributes mapping
for setting the column value, and should set the value of <em class="parameter"><code>cell_layout</code></em>'s
cell renderer(s) as appropriate.
</p>
<p>
<em class="parameter"><code>func</code></em> may be <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> to remove a previously set function.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
<td>the <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayoutDataFunc" title="GtkCellLayoutDataFunc ()"><span class="type">GtkCellLayoutDataFunc</span></a> to use, or <a href="../glib/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
<td>user data for <em class="parameter"><code>func</code></em>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>destroy</code></em> :</span></p></td>
<td>destroy notify for <em class="parameter"><code>func_data</code></em>
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
<hr>
<div class="refsect2">
<a name="gtk-cell-layout-clear-attributes"></a><h3>gtk_cell_layout_clear_attributes ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_cell_layout_clear_attributes    (<em class="parameter"><code><a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a> *cell_layout</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> *cell</code></em>);</pre>
<p>
Clears all existing attributes previously set with
<a class="link" href="gtk3-GtkCellLayout.html#gtk-cell-layout-set-attributes" title="gtk_cell_layout_set_attributes ()"><code class="function">gtk_cell_layout_set_attributes()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell_layout</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellLayout.html#GtkCellLayout" title="GtkCellLayout"><span class="type">GtkCellLayout</span></a>
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>cell</code></em> :</span></p></td>
<td>a <a class="link" href="gtk3-GtkCellRenderer.html#GtkCellRenderer" title="struct GtkCellRenderer"><span class="type">GtkCellRenderer</span></a> to clear the attribute mapping on</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.4</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>